package net.oschina.app.hjp1;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * Created by Administrator on 2017/7/13 0013.
 */

public class TestputBean<T> {


    private  Call<T> call;
    private T body;

    public TestputBean(Call<T> call) {

        this.call = call;
        getData();

    }

    private void getData(){
        call.enqueue(new Callback<T>() {
            @Override
            public void onResponse(Call<T> call, Response<T> response) {
                body = response.body();


            }

            @Override
            public void onFailure(Call<T> call, Throwable t) {

            }
        });
    }


    public T getSet(){

        return  body;

    }


    TestCall<T> mtestCall;
    interface TestCall<T>{
        T getBody();
    }
    public void getTestCall(TestCall<T> testCall){
        mtestCall  = testCall;
    }




}
